package k4_thread.demo06;

public class Number implements Runnable {

    @Override
    public void run() {

        int num = 100000;

        while(num>0){
            num--;
        }

        System.out.println(Thread.currentThread().getName()+"执行完毕");
    }
}

class Test{
    public static void main(String[] args) {

        Thread t1 = new Thread(new Number(),"t1");
        t1.setPriority(10);
        Thread t2 = new Thread(new Number(),"t2");
        t2.setPriority(1);
        Thread t3 = new Thread(new Number(),"t3");
        t3.setPriority(1);
        Thread t4 = new Thread(new Number(),"t4");
        t4.setPriority(1);
        Thread t5 = new Thread(new Number(),"t5");
        t5.setPriority(1);
        Thread t6 = new Thread(new Number(),"t6");
        t6.setPriority(1);
        Thread t7 = new Thread(new Number(),"t7");
        t7.setPriority(1);
        Thread t8 = new Thread(new Number(),"t8");
        t8.setPriority(1);
        Thread t9 = new Thread(new Number(),"t9");
        t9.setPriority(1);
        Thread t10 = new Thread(new Number(),"t10");
        t10.setPriority(1);

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();
        t7.start();
        t8.start();
        t9.start();
        t10.start();
    }
}